<%--
  Created by IntelliJ IDEA.
  User: Lemon
  Date: 2020/6/11
  Time: 14:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>客户成交量</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <!-- 引入 ECharts 文件 -->
    <script src="${pageContext.request.contextPath}/static/js/echarts.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css"  media="all">
</head>
<body>


<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-md12">
            <form class="layui-form" action="" style="margin-top:30px;">
                <div class="layui-form-item" style="text-align:center;">
                    <div class="layui-inline">
                        <label class="layui-form-label">范围</label>
                        <div class="layui-input-inline" style="width:100px;">
                            <input type="text" class="layui-input" id="start_Time">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width:100px;">
                            <input type="text" class="layui-input" id="end_Time">
                        </div>
                        <button id="rankButton" class="layui-btn layui-btn-primary" type="button">确定</button>
                    </div>
                </div>
            </form>
            <div id="customerVolume" style="width:100%;height:500px">
            </div>
        </div>
    </div>
</div>
</body>
<script src="${pageContext.request.contextPath}/static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript">
    layui.use(['element','jquery','layer','form','laydate','layedit'], function() {
        var $ = layui.jquery
            ,element = layui.element;
        var layer = layui.layer;
        var form = layui.form;
        var laydate = layui.laydate;

        layui.laydate.render({
            elem: '#start_Time' //指定元素
        });

        layui.laydate.render({
            elem: '#end_Time' //指定元素
        });

        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('customerVolume'));

        // 指定图表的配置项和数据
        var option = {
            title: {
                text: '客户与公司的成交额前十',
                subtext: '数据来自东软客户关系管理系统'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            toolbox:{  //工具栏
                show: true,
                feature:{
                    dataView: {readOnly: false},
                    magicType: {type: [ 'bar']},  //图形切换
                    restore: {},
                    saveAsImage: {},
                },
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                max : 60,
                min : 0,
                splitNumber : 6,
            },
            yAxis: {
                data: ["吴彦祖","郭富城","吴亦凡","刘德华","周润发","张家辉","薛之谦"],
            },
            series: [
                {
                    name: '成交额',
                    type: 'bar',
                    stack: '状态',
                    data: [50,20,40,35,10,60,15]
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    });
</script>
</html>